<template>
    <view class="identityPage">
		<text class="title">{{title}}</text>
		<view class="identityList flex">
			<block v-for="item in firList" :key="item.type">
				<view class="itemBox flex" @click="toHouseProperty(item)">
					<view class="item flex">
						<text class="itemTit">{{item.title}}</text>
					</view>
				</view>
			</block>
		</view>

		<up-modal :show="showModelTxt" :closeOnClickOverlay="true" @close="showModelTxt=false" @confirm="showModelTxt=false">
			<view class="contentWrap flex">
				<view class="txtWrap flex bg-theme text-center col-fff font20 fontBold">
					<view>
						<view v-for="(item, index) in titList" :key="index">{{ item }}</view>
					</view>
				</view>
			</view>
		</up-modal>
    </view>
</template>

<script>
	export default {
        data() {
            return {
				title: "购买的房屋是首套还是二套房?",
				infos: {},
				firList: [
					{
						title: "首套房",
						type: true,
						desc: ""
					},
					{
						title: "二套房",
						type: false,
						desc: ""
					}
				],
				showModelTxt: false,
				titList: []
            }
        },
        //分享
        onShareAppMessage(res) {
        	return {
        		title: "上海限购查询，快来测测限购几套",
        		path: `/pages/tools/purchase/identity`,
        	}
        },
        onLoad(options){
			const optType = JSON.parse(options.info);
            // this.infos.houseFirst = optType;
			
        },
		methods:{
			toHouseProperty(info){
				this.infos.houseFirst = info.type;
				switch(info.type){
					case true:
					this.titList = ['外环外不限购','外环内限购2套'];
					this.showModelTxt = true;
					break;

					case false:
					uni.navigateTo({
						url: `/pages/tools/purchase/house-select?info=${JSON.stringify(this.infos)}`
					})
					break;
					
					default:
					break
				}
			}
		}
    }
</script>

<style scoped lang="scss">
	.identityPage{
		::v-deep .u-modal__content{
            padding: 0 !important;
            display: block !important;
        }
		.title{
			margin-top: 20vh;
			font-size: 40rpx;
			text-align: center;
			display: block;
		}
		.identityList{
			flex-wrap: wrap;
			.itemBox{
				width: 33.3333%;
				height: 200rpx;
				margin-top: 60rpx;
				.item{
					width: 200rpx;
					height: 200rpx;
					text-align: center;
					border-radius: 50%;
					border: 1rpx solid $theme-color;
					flex-direction: column;
					font-size: 24rpx;
					line-height: 1.3;
					.itemTit{
						font-size: 32rpx;
						margin-bottom: 10rpx;
					}
				}
			}
		}
		.contentWrap{
			padding: 40rpx 0;
			.txtWrap{
				padding: 20rpx;
				width: 40vw;
				height: 40vw;
				line-height: 1.4;
				border-radius: 50%;
			}
			.pangFigure{
				width: 40vw;
				margin-left: -64rpx;
			}
		}
	}

</style>
